import request from '@/utils/request.js'
import { useTokenStore } from '@/stores/token.js'
//文章分类
export const articleCategoryService = () => {
    return request.get('/category')
}

//文章分类接口
export const articleCategoryAddService = (categoryData) => {
    return request.post('/category', categoryData)
}

//更新文章分类接口
export const articleCategoryUpdateService = (categoryData) => {
    return request.put('/category', categoryData)
}

//删除文章分类接口
export const articleCategoryDeleteService = (id) => {
    return request.delete('/category?id=' + id)
}

//文章列表查询接口
export const articleListService = (params) => {
    return request.get('/article', { params: params })
}

//文章添加接口
export const articleAddService = (articleData) => {
    return request.post('/article', articleData)
}

//修改文章接口
export const articleUpdataService = (articleData) => {
    return request.put('/article', articleData)
}

//删除文章接口
export const articleDeleteService = (id) => {
    return request.delete('/article?id=' + id)
}